//
//  Texture2D.h
//  OpenGLES_03
//
//  Created by Keisuke Hata on 09/12/24.
//  Copyright 2009 Keisuke Hata. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <OpenGLES/ES1/glext.h>
#import "PVRTexture.h"

@interface Texture2D : NSObject 
{
	NSUInteger	_width;// テクスチャのサイズ( ２の累乗のサイズ )
	NSUInteger	_height;// テクスチャのサイズ( ２の累乗のサイズ ) 
	NSUInteger	_realwidth;// 実際の画像サイズ
	NSUInteger	_realheight;// 実際の画像サイズ
	GLuint		_name;
	UIImage		*_img;
	PVRTexture	*_pvrTexture;
	BOOL _pvr;
}

- (id) initWithContentsOfFile : (NSString *)path;
- (id) initWithContentsOfURL : (NSURL *)url;
- (id) initWithSize : (CGSize)size;

@property (readonly) NSUInteger width;
@property (readonly) NSUInteger height;
@property (readonly) NSUInteger realwidth;
@property (readonly) NSUInteger realheight;
@property (readonly) BOOL pvr;
@property (readonly) BOOL hasMipmap;

@property (readonly) GLuint name;
@property (nonatomic,retain) UIImage *img;

@end

@interface Texture2D( PVRTC )

- (id)initWithContentsOfPVRTCFile:(NSString *)path;
- (id)initWithContentsOfPVRTCURL:(NSURL *)url;

@end

@interface Texture2D( Text )

- (id)initWithColorText:(NSString *)text 
			  fontColor:(UIColor *)color
		  fontAlignment:(UITextAlignment)alignment 
			   fontName:(NSString *)name
			   fontSize:(CGFloat)size;
	
@end
